import { getList, dataList } from '../api/index'

export let get_List = () => {
    return async dispatch => {
        let { data } = await getList()
        dispatch({
            type: 'GET_LIST',
            payload: data
        })
    }
}

export let click_Btn = (index) => {
    return dispatch => {
        dispatch({
            type: 'CLICK_BTN',
            payload: index
        })
    }
}

export let data_List = (page, pageNum) => {
    return async dispatch => {
        let { data } = await dataList(page, pageNum)
        dispatch({
            type: 'DATA_LIST',
            payload: data
        })
    }
}